import request from '@/utils/request'
import type { loginType, userInfoType } from './type'

// 统一管理api
// 枚举类型
enum API {
  LOGIN_API = '/admin/acl/index/login',
  USERINFO_API = '/admin/acl/index/info',
  LOGOUT_API = '/admin/acl/index/logout',
}

export const loginAPI = (data: loginType) =>
  request<string>('POST', API.LOGIN_API, data)

export const getUserInfo = () => request<userInfoType>('GET', API.USERINFO_API)

export const logoutAPI = () => request('POST', API.LOGOUT_API)
